package com.lebang.model.enums;


public enum CheckRoot {
    /**
     * 屏蔽数据
     */
    root("root账号", 1),
    ;

    private String title;
    private int index;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    private CheckRoot(String title, int index) {
        this.title = title;
        this.index = index;
    }

    public CheckRoot getByIndex(int index) {
        for (CheckRoot e : CheckRoot.values()) {
            if (e.index == index) {
                return e;
            }
        }
        return null;
    }

    public CheckRoot getByTitle(String title) {
        if (null == title) {
            return null;
        }
        for (CheckRoot e : CheckRoot.values()) {
            if (e.title.equals(title)) {
                return e;
            }
        }
        return null;
    }
}
